<?php
ini_set('display_errors', 0);
  session_start();  
$_SESSION['usuarios'];
$_SESSION['passwords'];

if ($_SESSION['usuarios'] == "" and $_SESSION['passwords'] == ""){
	echo " uste no tiene permiso pa ver esta pagina";
	die;
}
$usuarios6 = $_SESSION['usuarios'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title> Sistema Integral de Bienestar Social</title>
<link href="media/styles00.css" rel="stylesheet" type="text/css" />
<link href="media/nivo-sli.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="media/jquery-1.js"></script>
<script type="text/javascript" src="media/jquery00.js"></script>
<script src="media/cufon-yu.js" type="text/javascript"></script>
<script src="media/Sunshine.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1');
Cufon.replace('h3');
Cufon.replace('.special_font');
Cufon.replace('h2 a', {
	hover: true
});
Cufon.replace('h2');
Cufon.replace('#navigation a', {
	hover: true
});
</script>
<script type="text/javascript" src="media/jquery01.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
<!--[if IE 6]><script defer type="text/javascript" src="js/pngfix.js"></script><![endif]-->
<!--[if !IE 7]>
<style type="text/css">
#bg_top {display:table;height:100%}
h1 {padding-top:5px;}
</style>
<![endif]-->
<link rel="stylesheet" href="media/jquery00.css" type="text/css" />
<script type="text/javascript" src="media/jquery02.js"></script>
<script type="text/javascript">
$(function() { $('.lightbox').lightBox(); });
</script>
</head>
<body>
<div id="bg_top">
  <div id="wrapper">
    <div id="header">
      <div id="logo"><img src="media/logo0000.png" width="289" height="54" alt="Logo" /></div>
      <div id="cloud1" class="special_font"> otic  </div>
      <div id="cloud2" class="special_font"> m.p.p.s</div>
      <div id="menu">
        <ul id="navigation">
          <a  style="border:none;"> Sistema Integral de Bienestar Social</a>
        </ul>
      </div>
    </div>
    <div id="content_bg">
      <div id="content">
        
        
  <p align="center">
<?php 
include 'conex.php';
$nac = $_REQUEST['nac'];
$cedula = $_REQUEST['cedula'];
date_default_timezone_set('America/Caracas');
$ip = $_SERVER['REMOTE_ADDR'];
	$ano = date('Y');
	$mes = date('m');
	$dia = date('d');
	$hora = date('h:i:s A');

$query= "INSERT INTO historico_movimiento (usuario, tipo_movimiento, dia, mes, ano, hora, ip, tabla, descripcion) 
VALUES ('$usuarios6','1','$dia','$mes','$ano','$hora','$ip','guar_trabajador','$cedula');";
pg_query($query) or die ('Error insertando');


$consulta="select * from guar_trabajador where nac = '$nac' and cedula = '$cedula'"; 

$consulta=pg_query($consulta);
while ($var = pg_fetch_array($consulta)) {
$consulta_cedula = $var['cedula']; }

if ($consulta_cedula== "" ){
echo "C&eacute;dula No Registrada.";
}

?>
</p>

<?php

				$Consultas = "select * from guar_trabajador where nac = '$nac' and cedula = '$cedula'";
				$resultados = pg_query($Consultas);
				?>
				</p>
				<?php

$linea= pg_fetch_array($resultados)
?>


          
		<table align="center" width="440px" height="120px">
		<td  align="center" width="250px">
          <h1>Consulta del Trabajador</h1>
          
          
          <form name= "consulta_trabajador" id= "consulta_trabajador" method= "post" action= "consulta_hijos.php">
<table width= "600" align= "center">
				<Tr>
                   <td width= "290"><font class= "color"> C&eacute;dula: </font>
                   	<input type= "text" readonly="" name="nac" size= "1" maxlength = "1" value="<?php echo $linea['nac']; ?>">
					<input type= "text" readonly="" name="cedula" value="<?php echo $linea['cedula']; ?>">
					</td>
					<td width= "250"><font class= "color"> C&oacute;digo: </font>
					<input type= "text" readonly="" value="<?php echo $linea['codigo']; ?>">
					</td>
				</tr>
				<tr>
					<td><font class= "color"> Nombres: </font>
					<input type= "text" readonly="" value="<?php echo $linea['nombres']; ?>">
					</td>
					<td><font class= "color"> Apellidos: </font>
					<input type= "text" readonly="" value="<?php echo $linea['apellidos']; ?>">
					</td>
				</tr>
				<tr>
					<td><font class= "color"> Cargo: </font>
					<input type= "text" readonly="" value="<?php echo $linea['id_cargo']; ?>">
					</td>
					<td><font class= "color"> N&uacute;mero Tel&eacute;fonico: </font>
					<input type= "text" readonly="" style="width:125px" value="<?php echo $linea['telefono']; ?>">
					</td>
				</tr>
				<tr>
					<td><font class= "color"> Ubicaci&oacute;n Administrativa: </font>
					<input type= "text" readonly="" value="<?php echo $linea['id_ubi_adm']; ?>">
					</td>
					<td><font class= "color"> Ubicaci&oacute;n F&iacute;sica: </font>
					<input type= "text" readonly="" value="<?php echo $linea['id_fisica']; ?>">
					</td>
				</tr>
				<tr>
					<td><font class= "color"> Sexo: </font>
					<input type= "text" readonly="" value="<?php echo $linea['sexo']; ?>">
					</td>
					<td><font class= "color"> N&uacute;mero Extensi&oacute;n: </font>
					<input type= "text" readonly="" style="width:130px" value="<?php echo $linea['extension']; ?>">
					</td>
				</tr>
				<tr><td><font class= "color"> Tipo de Personal: </font>
					<input type= "text" readonly="" value="<?php echo $linea['id_tipo_personal']; ?>">
					<td><font class= "color"> Estatus: </font>
<?php if ($linea['estatus'] == "A"){ ?><input type= "text" readonly="" value="ACTIVO">
<?php } if ($linea['estatus'] == "E"){ ?><input type= "text" readonly="" value="EGRESO">
<?php } if ($linea['estatus'] == "I"){ ?><input type= "text" readonly="" value="INACTIVO"><?php } ?>
					<td>
				</tr>
				</table>
				

<?php 
	$hijo="select nombres_hijo||' '||apellidos_hijo as hijo, id_hijo from guar_hijo where nac = '$nac' and cedula = '$cedula'";
			$resulta=pg_query($hijo);
?>
				
				
				
				<h1><p align="center"><font color= "#fffff" size = 5> Consulta por nombre del hijo: </font></p></h1>
				<P align="center"><select name="id_hijo" style="width:200px"> 
<?php
while($linea_hijo= pg_fetch_array($resulta))
{

?>

<option  value="<?php echo $linea_hijo['id_hijo']; ?>"><?php echo $linea_hijo['hijo']; ?></option>
<?php
}
?>

</select></P>
				
					<p align="center">
						<br>
						<input type="submit" value="Consultar"/>
						</br>
						<br></br>
						<br>
						<a href="consulta_user.php"><img src="1356055280_Forward-64.png" height="30px" width="30px" /></a>
						</br>
						</p>
						</form>
        </td>
		</table>
          <p>&nbsp;</p>
        </div>
        <br class="clear" />
      </div>
      <br class="clear" />
    </div>
    <div id="content_bottom"><img src="media/content_.jpg" width="980" height="5" alt="bottom" /></div>
    <div id="footer">
     
    </div>
  </div>
</div>
<div id="grass">
  <div id="footer_design"> </div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
</body>
</html>